home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8707 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: news.crystalball.com!news
  2. From: Larry Weiss <lfw@oc.com>
  3. Newsgroups: comp.lang.c
  4. Subject: C coding standards
  5. Date: Mon, 04 Mar 1996 13:32:24 -0600
  6. Organization: crystalball.com
  7. Message-ID: <313B4548.45AA@oc.com>
  8. References: <4g0elg$mdr@redstone.interpath.net> <4h0bbo$c0q@fohnix.metronet.com> <4h7ce0$ojd@news.interpath.net> <4h85sm$lm0@texas.nwlink.com>
  9. NNTP-Posting-Host: external.oc.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Teresa Reiko wrote:
  16.  > 
  17.  > In this book and others, notably 'Code Complete', these programming
  18.  > guides published by Microsoft Press, it is evident why Microsoft put
  19.  > so many bugs in Windows 95.  Here are the three worst Microsoft
  20.  > coding rules, in my opinion at least:
  21.  > 
  22.  > Every line of code must contain a comment.
  23.  > Any number greater than 2 must be a named constant.
  24.  > No procedure may be longer than 25 lines.
  25.  > 
  26.  > If you follow these rules, you can be sure to write buggy, inefficient
  27.  > code that is difficult to revise and will generally look 'dirty'.
  28.  > Of course, if this is your intent, that's OK, but...
  29.  
  30.  
  31. Does your organization have any coding guidelines?
  32.  
  33. If so, what are the rules that you follow with respect to:
  34.    o comment frequency?
  35.    o use of numeric literals?
  36.    o text length of a function?
  37.  
  38. My organizational guideline's answers to these questions are:
  39.  
  40.    o block comments are better than line-by-line comments, but line-by-line
  41.      comments are allowed; avoid excessive commenting; and there are specific
  42.      typographics formats that comments have, including comments that must be
  43.      formatted to more than one line
  44.  
  45.    o no mention of restrictions on use of numeric literals 
  46.  
  47.    o no mention of restrictions on function declaration length, but overall
  48.      a suggestion (not strict) to keep entire modules to less than 1000 lines
  49.      of code
  50.  
  51. So we do differ from the "Code Complete" guidelines.
  52.